<?php

namespace Home\Controller;
use Think\Controller;
use Common\Controller\PrettyRestController;

class IndexController extends PrettyRestController {
    
    protected $allowMethod = array('get');
    protected $allowType = array('json');

    public function index(){

        switch ($this->_method) {
            case 'get':
                $data = array(
                    // auth related api
                    "Auth" => array(
                        "url" => "http://api.example.com/auth",
                        "method" => "get",
                        "content" => "user login",
                        "param" => array(
                            "@token" => "token, if you have one",
                            "@uid" => "uid, if you have one",
                            "@username" => "username",
                            "@password" => "Password, salt hashed",
                        ),
                        "return" => array(
                            "userinfo if loged in ok",
                            "error message if not loged in",
                        ),
                    ),

                    // user related api
                    "User" => array(
                    
                    ),

                );

                $this->docResponse($data);
                break;

            default : 
                $this->docResponse("Invalid Request");
        }
    }
}
